package com.xinqi.modules.course.clazz.client;


import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.R;
import com.xinqi.common.rocketmq.dto.CourseClassMessageBody;
import com.xinqi.modules.course.clazz.dto.rsp.ClassResultDTO;
import com.xinqi.modules.course.clazz.factory.ClassFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @version V1.0
 * @Title: 班级接口
 * @ClassName: com.xinqi.modules.course.course.clazz.dto.client.ClassClient.java
 * @Description:
 * @Copyright 星齐科技（云南）有限公司 - Powered By 技术部
 * @author: yyzhen
 * @date: 2023/8/14 20:09
 */
@FeignClient(contextId = "classClient", value = ServiceNameConstants.XQ_COURSE, fallbackFactory = ClassFallbackFactory.class)
public interface ClassClient {

    /**
     * 班级MQ消息处理接口
     * @param body
     * @return
     */
    @PostMapping("/inner/class/processingClass")
    R<Void> processingClass(@RequestBody CourseClassMessageBody body);

    /**
     * 班级MQ消息处理接口
     * @param classId
     * @return
     */
    @GetMapping("/inner/class/find/{classId}")
    R<ClassResultDTO> findClass(@PathVariable("classId") Long classId);

    /**
     * 获取所有班级信息
     * @return
     */
    @GetMapping("/inner/class/find/all")
    R<List<ClassResultDTO>> findAllClass();

}
